<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">

  <xi:include href="tb-master.html" />

<head>
	<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
  	<title></title>
  	${tmpl_context.googlemaps_js()}
  	${tmpl_context.zeroisp_fileupload()}
  	<script type="text/javascript">
  	jQuery(function() {
    	jQuery('.wymeditor').wymeditor();});
    </script>

</head>
<body>
	<div id="tabs">
		<ul>
			<li py:for="s in steps"><h3><a href="#tabs-${s}">${steps.index(s)}. ${steps_map[s]}</a></h3></li>
			<li>
				<py:with vars="flash=tg.flash_obj.render('flash', use_js=False)">
        			<div py:if="flash" class="success" py:content="XML(flash)" />
    			</py:with>
    		</li>
		</ul>
		<div py:if="'address' in steps" id="tabs-address" style="padding: 5px;" >
			${tb_addressform()}
		</div>

		<div id="tabs-description">
			${tmpl_context.description_form(value=session['post'])}
		</div>

		<div py:if="'details'in steps" id="tabs-details">
			<div>
				${tmpl_context.datails_form(value=session['post_meta'])}
			</div>
		</div>
		<div py:if="'photos'in steps" id="tabs-photos" >
			<div >
				<div >
					<form action="/toolbox/post/save_photos_todo/${post_new}" method="POST" enctype="multipart/form-data" class="P10">
			       		<fieldset >
			       		<script type="text/javascript" language="javascript">
									$(function(){ // wait for document to load
		 								$('#T7').MultiFile({
		  									list: '#T7-list'
		 								});
									});
						</script>
			        	<legend><strong>Form Upload Photos</strong></legend>
			        	<p>Add photos and click on save</p>
						<input type="file" name="T7" id="T7"/>
						<input type="submit" value="save" />
						<hr />
			        	<legend id="google_address_legend">To Upload</legend>
			       		<div id="T7-list" ></div>
			       		</fieldset>
			        </form>
			     </div>
			     <div >
			     	<fieldset>
			     		<legend><strong></strong></legend>
						<div py:for="photo in session['photos_todo']" class="span-2">
							<p><img  src="${photo}" alt="${photo}" height="50px"/></p>
						</div>
			       	</fieldset>
			    </div>
			</div>
		</div>
		<div id="tabs-save">
			<h1 py:if="session['post'].has_key('post_title')">${session['post']['post_title']}</h1>
	     	<fieldset>
	     		<legend><strong>Description</strong></legend>
	     		<p py:if="session['post'].has_key('post_event')">${session['post']['post_event']}</p>
	     		<py:if test="session['post'].has_key('post_content')">
	     		${XML('&lt;div&gt;'+session['post']['post_content']+'&lt;/div&gt;')}
	     		</py:if>
	       	</fieldset>
			<fieldset py:if="'details' in steps">
	     		<legend><strong>Details</strong></legend>
				<table class="span-12" py:if="len(session['post_meta'].keys()) > 0">
					<py:for each="field in tmpl_context.datails_form.children">
	     			<tr py:if="field.name">
	     				<th>${field.label_text}</th>
	     				<td>${str(session['post_meta'][field.name])}</td>
	     			</tr>
	     			</py:for>
	     		</table>
	       	</fieldset>
	     	<fieldset py:if="'photos' in steps">
	     		<legend><strong>Photos</strong></legend>
				<div py:for="photo in session['photos_todo']" >
					<p><img  src="${photo}" alt="${photo}" height="50px"/></p>
				</div>
	       	</fieldset>
			<fieldset py:if="'address' in steps">
	     		<legend><strong>Address</strong></legend>
				<table py:if="len(session['address'].keys()) > 0">
	     			<tr py:for="field in tmpl_context.address_form.fields()">
	     				<th>${field.label_text}</th>
	     				<td>${session['address'][field.name]}</td>
	     			</tr>
	     		</table>
	       	</fieldset>
		    ${tmpl_context.session_form()}
		</div>
</div>
</body>
</html>
